import Vue from 'vue'
import VueRouter from 'vue-router'
import MSite from '../pages/MSite/MSite.vue'
import Search from '../pages/Search/Search.vue'
import Profile from '../pages/Profile/Profile.vue'
import Order from '../pages/Order/Order.vue'
import Login from '../pages/Login/Login.vue'
import email from  '../pages/Login/email.vue'
import number from  '../pages/Login/number.vue'
import shop from '../pages/shop/shop.vue'
import shopgoods from '../pages/shop/shopGoods/shopGoods.vue'
import shopinfo from '../pages/shop/shopInfo/shopInfo.vue'
import shopratings from '../pages/shop/shopRatings/shopratings.vue'

Vue.use(VueRouter)
export default  new VueRouter({
    routes:[
        {
            path:'/msite',
            component:MSite,
            meta:{
                showFooter:true
            }
        },
        {
            path:'/Search',
            component:Search,
            meta:{
                showFooter:true
            }
        },
        {
            path:'/profile',
            component:Profile,
            meta:{
                showFooter:true
            }
        },
        {
            path:'/order',
            component:Order,
            meta:{
                showFooter:true
            }
        },
        {
            path:'/login',
            component:Login
        },
        {
            path:'/email',
            component:email
        },
        {
            path:'/number',
            component:number
        },
        {
            path:'/',
            redirect:'/msite'
        },
        {
            path:'/shop',
            component:shop,
            children:[
                {
                    path:'/shop/goods',
                    component:shopgoods
                },
                {
                    path:'/shop/info',
                    component:shopinfo
                },
                {
                    path:'/shop/ratings',
                    component:shopratings
                },
                {
                    path:'',
                    redirect:'/shop/goods' //初始路由
                },
            ]
        }
    ]
})